/********************************************************************
* ABOUT : This class is for doing various operations on Quaternions.
*
* AUTHOR : Dilawar Singh
*
* Written on : April 28, 2010
*
* Modified on : 
* 
* Dilawar Singh Pvt. Ltd. 2010
**********************************************************************/

#ifndef _IS_QUATERNION_K_H_
#define _IS_QUATERNION_K_H_

#include<iostream>
#include "stabilize_config.h"
#include "is_homography_matrix_K.h"

class IsQuaternionK : public IsMatrixK
{
public:
    kalmanType lpfQuaternion[QUAT_LENGTH]; // Low pass filtered quaternion.
    kalmanType kcQuaternion[QUAT_LENGTH];  // Kalman Corrected quaternion.
    kalmanType myRotationMatrix[R_MATRIX_LENGTH]; // Rotation Matrix of a quaternions.
   
    // kalmanType myRotMarBetweenQuats[R_MATRIX_LENGTH];

public:
    
    // constructors
    IsQuaternionK();
    IsQuaternionK(kalmanType*);
      
    /* This function will calculate the normalised quaternion */
    void normalizeQuatK(kalmanType IsQuaternionK[QUAT_LENGTH]);
    
    /* This function will invert the quaternion */
    void invertQuaternion(kalmanType IsQuaternionK[QUAT_LENGTH]);
    
    /* This will calculate the rotation matrix for a single quaternion*/
    void quatToRotationMat(kalmanType *pIsQuaternionK);

    /* This will calculate the rotationMatrix between two quaternions. */

    
    /* This will calculate the hamiltonian product. */
    kalmanType* hamiltonionProduct(kalmanType *plpfQuaternion, 
        kalmanType *pthIsQuaternionK);
public:
    virtual ~IsQuaternionK(void);
};
#endif
